package com.hyj.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hyj.service.NetfollowsService;
import com.hyj.mapper.NetfollowsMapper;
import com.hyj.entity.Fenye;
import com.hyj.entity.Netfollows;
import com.hyj.entity.Students;
import com.hyj.entity.Users;
@Service
public class NetfollowsServiceImp implements NetfollowsService{
	@Autowired
	private NetfollowsMapper netfollowsmapper;
		//查询总数据
		@Override
		public Fenye<Netfollows> selectNetfollows(Fenye<Netfollows> fenye) {
			// TODO Auto-generated method stub
			List<Netfollows> selectNetfollows = netfollowsmapper.selectNetfollows(fenye);
			fenye.setRows(selectNetfollows);
			Integer countNetfollows = netfollowsmapper.countNetfollows(fenye);
			fenye.setTotal(countNetfollows);
			return fenye;
		}
		//查询所有用户
		@Override
		public List<Users> selectUsers() {
			// TODO Auto-generated method stub
			return netfollowsmapper.selectUsers();
		}
		//查询所有学生
		@Override
		public List<Students> selectStu() {
			// TODO Auto-generated method stub
			return netfollowsmapper.selectStu();
		}
		//查询已回访总数据
		@Override
		public Fenye<Netfollows> selectYesHiuFang(Fenye<Netfollows> fenye) {
			// TODO Auto-generated method stub
			List<Netfollows> selectYesHiuFang = netfollowsmapper.selectYesHiuFang(fenye);
			fenye.setRows(selectYesHiuFang);
	        Integer countYesHiuFang = netfollowsmapper.countYesHiuFang(fenye);
			fenye.setTotal(countYesHiuFang);
			return fenye;
		}
		//查看回访
		@Override
		public Fenye<Netfollows> lookHiuFang(Fenye<Netfollows> fenye) {
			List<Netfollows> lookHiuFang = netfollowsmapper.lookHiuFang(fenye);
			fenye.setRows(lookHiuFang);
			Integer countlookHiuFang = netfollowsmapper.countlookHiuFang(fenye);
			fenye.setTotal(countlookHiuFang);
			return fenye;
		}

}
